<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    
    <title>numpy.polynomial.chebyshev.chebint &mdash; NumPy v1.18 Manual</title>
    
    <link rel="stylesheet" type="text/css" href="../../_static/css/spc-bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../../_static/css/spc-extend.css">
    <link rel="stylesheet" href="../../_static/scipy.css" type="text/css" >
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" >
    <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" >
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.18.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/language_data.js"></script>
    <script type="text/javascript" src="../../_static/js/copybutton.js"></script>
    <link rel="author" title="About these documents" href="../../about.html" >
    <link rel="index" title="Index" href="../../genindex.html" >
    <link rel="search" title="Search" href="../../search.html" >
    <link rel="top" title="NumPy v1.18 Manual" href="../../index.html" >
    <link rel="up" title="Chebyshev Module (numpy.polynomial.chebyshev)" href="../routines.polynomials.chebyshev.html" >
    <link rel="next" title="numpy.polynomial.chebyshev.chebadd" href="numpy.polynomial.chebyshev.chebadd.html" >
    <link rel="prev" title="numpy.polynomial.chebyshev.chebder" href="numpy.polynomial.chebyshev.chebder.html" > 
  </head>
  <body>
<div class="container">
  <div class="top-scipy-org-logo-header" style="background-color: #a2bae8;">
    <a href="../../index.html">
      <img border=0 alt="NumPy" src="../../_static/numpy_logo.png"></a>
    </div>
  </div>
</div>


    <div class="container">
      <div class="main">
        
	<div class="row-fluid">
	  <div class="span12">
	    <div class="spc-navbar">
              
    <ul class="nav nav-pills pull-left">
        <li class="active"><a href="https://numpy.org/">NumPy.org</a></li>
        <li class="active"><a href="https://numpy.org/doc">Docs</a></li>
        
        <li class="active"><a href="../../index.html">NumPy v1.18 Manual</a></li>
        

          <li class="active"><a href="../index.html" >NumPy Reference</a></li>
          <li class="active"><a href="../routines.html" >Routines</a></li>
          <li class="active"><a href="../routines.polynomials.html" >Polynomials</a></li>
          <li class="active"><a href="../routines.polynomials.package.html" >Polynomial Package</a></li>
          <li class="active"><a href="../routines.polynomials.chebyshev.html" accesskey="U">Chebyshev Module (<code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy.polynomial.chebyshev</span></code>)</a></li> 
    </ul>
              
              
    <ul class="nav nav-pills pull-right">
      <li class="active">
        <a href="../../genindex.html" title="General Index"
           accesskey="I">index</a>
      </li>
      <li class="active">
        <a href="numpy.polynomial.chebyshev.chebadd.html" title="numpy.polynomial.chebyshev.chebadd"
           accesskey="N">next</a>
      </li>
      <li class="active">
        <a href="numpy.polynomial.chebyshev.chebder.html" title="numpy.polynomial.chebyshev.chebder"
           accesskey="P">previous</a>
      </li>
    </ul>
              
	    </div>
	  </div>
	</div>
        

	<div class="row-fluid">
      <div class="spc-rightsidebar span3">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="numpy.polynomial.chebyshev.chebder.html"
                        title="previous chapter">numpy.polynomial.chebyshev.chebder</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="numpy.polynomial.chebyshev.chebadd.html"
                        title="next chapter">numpy.polynomial.chebyshev.chebadd</a></p>
<div id="searchbox" style="display: none" role="search">
  <h4>Quick search</h4>
    <div>
    <form class="search" action="../../search.html" method="get">
      <input type="text" style="width: inherit;" name="q" />
      <input type="submit" value="search" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
          <div class="span9">
            
        <div class="bodywrapper">
          <div class="body" id="spc-section-body">
            
  <div class="section" id="numpy-polynomial-chebyshev-chebint">
<h1>numpy.polynomial.chebyshev.chebint<a class="headerlink" href="#numpy-polynomial-chebyshev-chebint" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="numpy.polynomial.chebyshev.chebint">
<code class="sig-prename descclassname">numpy.polynomial.chebyshev.</code><code class="sig-name descname">chebint</code><span class="sig-paren">(</span><em class="sig-param">c</em>, <em class="sig-param">m=1</em>, <em class="sig-param">k=[]</em>, <em class="sig-param">lbnd=0</em>, <em class="sig-param">scl=1</em>, <em class="sig-param">axis=0</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/numpy/numpy/blob/v1.18.1/numpy/polynomial/chebyshev.py#L944-L1069"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#numpy.polynomial.chebyshev.chebint" title="Permalink to this definition">¶</a></dt>
<dd><p>Integrate a Chebyshev series.</p>
<p>Returns the Chebyshev series coefficients <em class="xref py py-obj">c</em> integrated <em class="xref py py-obj">m</em> times from
<em class="xref py py-obj">lbnd</em> along <em class="xref py py-obj">axis</em>. At each iteration the resulting series is
<strong>multiplied</strong> by <em class="xref py py-obj">scl</em> and an integration constant, <em class="xref py py-obj">k</em>, is added.
The scaling factor is for use in a linear change of variable.  (“Buyer
beware”: note that, depending on what one is doing, one may want <em class="xref py py-obj">scl</em>
to be the reciprocal of what one might expect; for more information,
see the Notes section below.)  The argument <em class="xref py py-obj">c</em> is an array of
coefficients from low to high degree along each axis, e.g., [1,2,3]
represents the series <code class="docutils literal notranslate"><span class="pre">T_0</span> <span class="pre">+</span> <span class="pre">2*T_1</span> <span class="pre">+</span> <span class="pre">3*T_2</span></code> while [[1,2],[1,2]]
represents <code class="docutils literal notranslate"><span class="pre">1*T_0(x)*T_0(y)</span> <span class="pre">+</span> <span class="pre">1*T_1(x)*T_0(y)</span> <span class="pre">+</span> <span class="pre">2*T_0(x)*T_1(y)</span> <span class="pre">+</span>
<span class="pre">2*T_1(x)*T_1(y)</span></code> if axis=0 is <code class="docutils literal notranslate"><span class="pre">x</span></code> and axis=1 is <code class="docutils literal notranslate"><span class="pre">y</span></code>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>c</strong><span class="classifier">array_like</span></dt><dd><p>Array of Chebyshev series coefficients. If c is multidimensional
the different axis correspond to different variables with the
degree in each axis given by the corresponding index.</p>
</dd>
<dt><strong>m</strong><span class="classifier">int, optional</span></dt><dd><p>Order of integration, must be positive. (Default: 1)</p>
</dd>
<dt><strong>k</strong><span class="classifier">{[], list, scalar}, optional</span></dt><dd><p>Integration constant(s).  The value of the first integral at zero
is the first value in the list, the value of the second integral
at zero is the second value, etc.  If <code class="docutils literal notranslate"><span class="pre">k</span> <span class="pre">==</span> <span class="pre">[]</span></code> (the default),
all constants are set to zero.  If <code class="docutils literal notranslate"><span class="pre">m</span> <span class="pre">==</span> <span class="pre">1</span></code>, a single scalar can
be given instead of a list.</p>
</dd>
<dt><strong>lbnd</strong><span class="classifier">scalar, optional</span></dt><dd><p>The lower bound of the integral. (Default: 0)</p>
</dd>
<dt><strong>scl</strong><span class="classifier">scalar, optional</span></dt><dd><p>Following each integration the result is <em>multiplied</em> by <em class="xref py py-obj">scl</em>
before the integration constant is added. (Default: 1)</p>
</dd>
<dt><strong>axis</strong><span class="classifier">int, optional</span></dt><dd><p>Axis over which the integral is taken. (Default: 0).</p>
<div class="versionadded">
<p><span class="versionmodified added">New in version 1.7.0.</span></p>
</div>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><strong>S</strong><span class="classifier">ndarray</span></dt><dd><p>C-series coefficients of the integral.</p>
</dd>
</dl>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>ValueError</strong></dt><dd><p>If <code class="docutils literal notranslate"><span class="pre">m</span> <span class="pre">&lt;</span> <span class="pre">1</span></code>, <code class="docutils literal notranslate"><span class="pre">len(k)</span> <span class="pre">&gt;</span> <span class="pre">m</span></code>, <code class="docutils literal notranslate"><span class="pre">np.ndim(lbnd)</span> <span class="pre">!=</span> <span class="pre">0</span></code>, or
<code class="docutils literal notranslate"><span class="pre">np.ndim(scl)</span> <span class="pre">!=</span> <span class="pre">0</span></code>.</p>
</dd>
</dl>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="numpy.polynomial.chebyshev.chebder.html#numpy.polynomial.chebyshev.chebder" title="numpy.polynomial.chebyshev.chebder"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebder</span></code></a></p>
</div>
<p class="rubric">Notes</p>
<p>Note that the result of each integration is <em>multiplied</em> by <em class="xref py py-obj">scl</em>.
Why is this important to note?  Say one is making a linear change of
variable <img class="math" src="../../_images/math/f1149e7c6f7de3e7e6f56038c4c47b6b467bac2a.svg" alt="u = ax + b"/> in an integral relative to <em class="xref py py-obj">x</em>.  Then
<img class="math" src="../../_images/math/be769e642dd1ec3e3072c5506e4d73ded7b4b018.svg" alt="dx = du/a"/>, so one will need to set <em class="xref py py-obj">scl</em> equal to
<img class="math" src="../../_images/math/45ed8db4c9010e4d33a861dad6a7ef54c30608da.svg" alt="1/a"/>- perhaps not what one would have first thought.</p>
<p>Also note that, in general, the result of integrating a C-series needs
to be “reprojected” onto the C-series basis set.  Thus, typically,
the result of this function is “unintuitive,” albeit correct; see
Examples section below.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">numpy.polynomial</span> <span class="kn">import</span> <span class="n">chebyshev</span> <span class="k">as</span> <span class="n">C</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span><span class="o">.</span><span class="n">chebint</span><span class="p">(</span><span class="n">c</span><span class="p">)</span>
<span class="go">array([ 0.5, -0.5,  0.5,  0.5])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span><span class="o">.</span><span class="n">chebint</span><span class="p">(</span><span class="n">c</span><span class="p">,</span><span class="mi">3</span><span class="p">)</span>
<span class="go">array([ 0.03125   , -0.1875    ,  0.04166667, -0.05208333,  0.01041667, # may vary</span>
<span class="go">    0.00625   ])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span><span class="o">.</span><span class="n">chebint</span><span class="p">(</span><span class="n">c</span><span class="p">,</span> <span class="n">k</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="go">array([ 3.5, -0.5,  0.5,  0.5])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span><span class="o">.</span><span class="n">chebint</span><span class="p">(</span><span class="n">c</span><span class="p">,</span><span class="n">lbnd</span><span class="o">=-</span><span class="mi">2</span><span class="p">)</span>
<span class="go">array([ 8.5, -0.5,  0.5,  0.5])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span><span class="o">.</span><span class="n">chebint</span><span class="p">(</span><span class="n">c</span><span class="p">,</span><span class="n">scl</span><span class="o">=-</span><span class="mi">2</span><span class="p">)</span>
<span class="go">array([-1.,  1., -1., -1.])</span>
</pre></div>
</div>
</dd></dl>

</div>


          </div>
        </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container container-navbar-bottom">
      <div class="spc-navbar">
        
      </div>
    </div>
    <div class="container">
    <div class="footer">
    <div class="row-fluid">
    <ul class="inline pull-left">
      <li>
        &copy; Copyright 2008-2019, The SciPy community.
      </li>
      <li>
      Last updated on Feb 20, 2020.
      </li>
      <li>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.4.2.
      </li>
    </ul>
    </div>
    </div>
    </div>
  </body>
</html>